package hlhj.fhp.supreme.js

import android.app.Activity
import android.content.Context
import android.webkit.JavascriptInterface
import fhp.hlhj.giantfold.utils.LogUtil
import hlhj.fhp.supreme.javabean.JiePanCommitEvent
import hlhj.fhp.supreme.utils.SPHelper
import org.greenrobot.eventbus.EventBus

/**
 * Created by Never Fear   on 2018\7\18 0018.
Never More....
 */
class JiePanJs(private val id:String?,private val context: Context) {

    @JavascriptInterface
    fun getId(): String? {
        return id;
    }
    @JavascriptInterface
    fun getToken():String{
        return SPHelper.getToken(context);
    }
    @JavascriptInterface
    fun commit(htmlStr:String){
        LogUtil.e("fhpp","打印了${htmlStr}")
        val jiePanCommitEvent = JiePanCommitEvent()
        jiePanCommitEvent.htmlStr=htmlStr
        EventBus.getDefault().post(jiePanCommitEvent)
    }

}